from base.base_page import BasePage


class DocumentDetailPage(BasePage):

    # 文档详情页-添加
    def add_btn(self):
        return self.by_accessibility_id('添加').click()

    # 文档详情页-图像
    def image_btn(self):
        return self.by_accessibility_id('图像').click()

    # 文档详情页-识别
    def recognize_btn(self):
        return self.by_accessibility_id('识别').click()

    # 文字识别
    def text_recognize_btn(self):
        return self.by_id(self.HW_ENV + 'click_convert_txt').click()

    # 转Excel
    def convert_Excel_btn(self):
        return self.by_id(self.HW_ENV + 'click_convert_excel').click()

    # 转Word
    def convert_Word_btn(self):
        return self.by_id(self.HW_ENV + 'click_convert_word').click()

    # 导出
    def share_btn(self):
        return self.by_id(self.HW_ENV + 'img_share').click()

    # 当前页
    def single_page_btn(self):
        return self.by_id(self.HW_ENV + 'singlepage').click()

    # 完成
    def complete_btn(self):
        return self.by_id(self.HW_ENV + 'btn_complete').click()

    def back_btn(self):
        return self.by_xpath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.View/android.view.View/android.view.View/android.view.View/android.view.View[1]/android.widget.ImageView[1]').click()